﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Rendering.VisibleReflectionProbe
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;
using UnityEngine.Scripting;

#nullable disable
namespace UnityEngine.Rendering
{
  /// <summary>
  ///   <para>Holds data of a visible reflection reflectionProbe.</para>
  /// </summary>
  [UsedByNativeCode]
  public struct VisibleReflectionProbe : IEquatable<VisibleReflectionProbe>
  {
    private Bounds m_Bounds;
    private Matrix4x4 m_LocalToWorldMatrix;
    private Vector4 m_HdrData;
    private Vector3 m_Center;
    private float m_BlendDistance;
    private int m_Importance;
    private int m_BoxProjection;
    private int m_InstanceId;
    private int m_TextureId;

    /// <summary>
    ///   <para>Probe texture.</para>
    /// </summary>
    public Texture texture => (Texture) UnityEngine.Object.FindObjectFromInstanceID(this.m_TextureId);

    /// <summary>
    ///   <para>Accessor to ReflectionProbe component.</para>
    /// </summary>
    public ReflectionProbe reflectionProbe
    {
      get => (ReflectionProbe) UnityEngine.Object.FindObjectFromInstanceID(this.m_InstanceId);
    }

    /// <summary>
    ///   <para>The probe's world space axis-aligned bounding box in which the probe can contribute to reflections.</para>
    /// </summary>
    public Bounds bounds
    {
      get => this.m_Bounds;
      set => this.m_Bounds = value;
    }

    /// <summary>
    ///   <para>Probe transformation matrix.</para>
    /// </summary>
    public Matrix4x4 localToWorldMatrix
    {
      get => this.m_LocalToWorldMatrix;
      set => this.m_LocalToWorldMatrix = value;
    }

    /// <summary>
    ///   <para>Shader data for probe HDR texture decoding.</para>
    /// </summary>
    public Vector4 hdrData
    {
      get => this.m_HdrData;
      set => this.m_HdrData = value;
    }

    /// <summary>
    ///   <para>The center of the probe's bounding box in which the probe can contribute to reflections. The center is relative to the position of the probe.</para>
    /// </summary>
    public Vector3 center
    {
      get => this.m_Center;
      set => this.m_Center = value;
    }

    /// <summary>
    ///   <para>Probe blending distance.</para>
    /// </summary>
    public float blendDistance
    {
      get => this.m_BlendDistance;
      set => this.m_BlendDistance = value;
    }

    /// <summary>
    ///   <para>Probe importance.</para>
    /// </summary>
    public int importance
    {
      get => this.m_Importance;
      set => this.m_Importance = value;
    }

    /// <summary>
    ///   <para>Should probe use box projection.</para>
    /// </summary>
    public bool isBoxProjection
    {
      get => Convert.ToBoolean(this.m_BoxProjection);
      set => this.m_BoxProjection = Convert.ToInt32(value);
    }

    public bool Equals(VisibleReflectionProbe other)
    {
      return this.m_Bounds.Equals(other.m_Bounds) && this.m_LocalToWorldMatrix.Equals(other.m_LocalToWorldMatrix) && this.m_HdrData.Equals(other.m_HdrData) && this.m_Center.Equals(other.m_Center) && this.m_BlendDistance.Equals(other.m_BlendDistance) && this.m_Importance == other.m_Importance && this.m_BoxProjection == other.m_BoxProjection && this.m_InstanceId == other.m_InstanceId && this.m_TextureId == other.m_TextureId;
    }

    public override bool Equals(object obj)
    {
      return obj != null && obj is VisibleReflectionProbe other && this.Equals(other);
    }

    public override int GetHashCode()
    {
      return (((((((this.m_Bounds.GetHashCode() * 397 ^ this.m_LocalToWorldMatrix.GetHashCode()) * 397 ^ this.m_HdrData.GetHashCode()) * 397 ^ this.m_Center.GetHashCode()) * 397 ^ this.m_BlendDistance.GetHashCode()) * 397 ^ this.m_Importance) * 397 ^ this.m_BoxProjection) * 397 ^ this.m_InstanceId) * 397 ^ this.m_TextureId;
    }

    public static bool operator ==(VisibleReflectionProbe left, VisibleReflectionProbe right)
    {
      return left.Equals(right);
    }

    public static bool operator !=(VisibleReflectionProbe left, VisibleReflectionProbe right)
    {
      return !left.Equals(right);
    }
  }
}
